#ifndef _COOLANGAGE_VISITOR_H_
#define _COOLANGAGE_VISITOR_H_

#include <iostream>

template<typename R> class VisitorExpression;

#include "Expression.h"

namespace COOLangage {

  template<typename R> class VisitorExpression {
    R defValue;
  protected:
    VisitorExpression(R defaultValue) { this->defValue =  defaultValue; }    
  public:
    virtual ~VisitorExpression() throw() { }

    inline virtual R getDefaultValue() {
      return defValue;
    }
    
    inline virtual R visit(Expression *e) = 0;
    
    virtual R visitExpression(Expression *e) = 0;
    virtual R visitAppel(Appel *app)  = 0;
    virtual R visitLitEntier(LitEntier *ope) = 0;
    virtual R visitLitFlottant(LitFlottant *ope) = 0;
    virtual R visitVariable(Variable *var) = 0;    
    virtual R visitOperateurUnaire(OperateurUnaire *ope) = 0;
    virtual R visitOperateurBinaire(OperateurBinaire *ope) = 0;    
    template<typename K>  R visitLitteral(Litteral<K> *lit) = 0;
  };  
}

#endif
